#ifndef _TRACKER_H
#define _TRACKER_H
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <process.h>
#include <windows.h>

#include "linkedlist.h"


/* The number of frames to remember so we could find out that a car parked. 
 * Set to 150 cause: 30 frames a sec, 5 sec to remember => 150 frames.			*/
int const NUMBER_OF_POINTS=100; //150;

/* The radius of the circle that will be treated as "in the same spot" for parking recognition */
int const OFFSET_RADIUS=8;



class car{
public:
	int licensePlate;
	uchar blue,green,red ;
	int h , s ,v;
	bool first_time;
	CvPoint p;
	CvPoint PointArr[NUMBER_OF_POINTS];
	int IndexToPointArr;
	bool check_park;
	bool is_park;
	car() {
		IndexToPointArr=0;
		check_park = false;
		first_time = true;
		is_park = false;
	}
	bool operator==( const car &right ){
		return ((right.licensePlate==this->licensePlate));
	}  
};


CvPoint calculateCenter(IplImage* img,int *new_data , car & car_to_check);

int* ConvertFromRgbToHsv(IplImage* img);

bool startTrackingCar( CvCapture* capture);

bool carArrived( CvPoint center, int lp );

void  initParkinglot( void *dummy);




#endif